#2a Give the project to build a name 
PROJECT (TestRThreads)

set(CMAKE_CXX_STANDARD_REQUIRED ON) #为了避免Eigan运行出现对齐问题
set(CMAKE_CXX_STANDARD 17)

CMAKE_MINIMUM_REQUIRED(VERSION 3.5)

LIST(REMOVE_DUPLICATES TARGETS)

#print message
message(${PROJECT_NAME})

SET(LOCAL_LIBS_DIR "")

if (NOT CROSS_COMPLIE_PI)
	FIND_PACKAGE (Eigen3 3.0.0 REQUIRED)
	SET(ROBOLIB_PATH "/usr/local/RoboLib")

endif()

SET(BOOST_INC_DIR #
  /usr/include
  CACHE STRING
  "Location of the BOOST header files")

#wangchang
INCLUDE_DIRECTORIES ( 
	${EIGEN3_INCLUDE_DIR} 
	${PROJECT_SOURCE_DIR}/src
	#${PROJECT_SOURCE_DIR}/alglib-cpp/src
	${ROBOLIB_PATH}/lib_include

)

message("EIGEN3_INCLUDE_DIR       :" ${EIGEN3_INCLUDE_DIR})


ADD_EXECUTABLE(TestSharememMain
	TestSharememMain.cc
	test_share_mem.c
		)

ADD_EXECUTABLE(TestSharememRead
TestSharememRead.cc
test_share_mem.c
)

ADD_LIBRARY(test_share_mem SHARED
		test_share_mem.c

)

TARGET_LINK_LIBRARIES ( 
	TestSharememMain
	${ROBOLIB_PATH}/lib/libRTthreads.so
	${ROBOLIB_PATH}/lib/libaxis_base.so
	${ROBOLIB_PATH}/lib/libtools_share.so
	${ROBOLIB_PATH}/lib/libsharemem_base.so
	)
TARGET_LINK_LIBRARIES ( 
	TestSharememRead
	${ROBOLIB_PATH}/lib/libRTthreads.so
	${ROBOLIB_PATH}/lib/libaxis_base.so
	${ROBOLIB_PATH}/lib/libtools_share.so
	${ROBOLIB_PATH}/lib/libsharemem_base.so
	)


TARGET_LINK_LIBRARIES ( 
	test_share_mem
	${ROBOLIB_PATH}/lib/libsharemem_base.so
	${ROBOLIB_PATH}/lib/libtools_share.so
		)










